home *** CD-ROM | disk | FTP | other *** search
/ Power Programmierung 2 / Power-Programmierung CD 2 (Tewi)(1994).iso / c / library / bcfamily / source / qdir.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-12  |  721 b   |  33 lines

  1. //
  2. //      *******************************************************************
  3. //        JdeBP C++ Library Routines          General Public Licence v1.00
  4. //            Copyright (c) 1991,1992     Jonathan de Boyne Pollard
  5. //      *******************************************************************
  6. //
  7. // Part of FamAPI.LIB
  8. //
  9.  
  10. #include "famapi.h"
  11. #include "dosdos.h"
  12.  
  13. //
  14. //    Get current directory
  15. //
  16. USHORT _APICALL
  17. DosQCurDir    ( unsigned short Drive,
  18.               char far *Buf,
  19.               unsigned short far * RetLen)
  20. {
  21.     asm push ds ;
  22.     _DS = FP_SEG(Buf) ;
  23.     _SI = FP_OFF(Buf) ;
  24.     _DX = Drive ;
  25.     _AH = 0x47 ;
  26.     Dos3Call() ;
  27.     asm pop ds ;
  28.     if (_FLAGS & 0x0001) return _AX ;
  29.     *RetLen = 0 ;
  30.     while (*Buf++) ++*RetLen ;
  31.     return NO_ERROR ;
  32. }
  33.